package com.example.demo.service.impl;

import com.example.demo.dataobject.Insulin;
import com.example.demo.repository.InsulinRepository;
import com.example.demo.service.InsulinService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class InsulinServiceImpl implements InsulinService {

    @Autowired
    private InsulinRepository insulinRepository;

    @Override
    public List<Insulin> findAll() {
        List<Insulin> result = insulinRepository.findAll();
        return result;
    }

    @Override
    public List<Insulin> findByNameLikeOrderById(String name) {
        List<Insulin> result = insulinRepository.findByNameLikeOrderById(name);
        return result;
    }

    @Override
    public Insulin findByName(String name) {
        Insulin result = insulinRepository.findByName(name);
        return result;
    }
}
